package
{
	import flash.utils.*;
	
	public class Set
	{
		private var data:Array;
		
		public function Set()
		{
			data = new Array();
		}
		
		public function push(element:Object):void {
			if (data.indexOf(element) == -1) {
				data.push(element);
			}
		}
		
		public function toString():String {
			return data.toString();
		}
		
		public function toArray():Array {
			// for numerical string contents
			// sort the data as best as we can
			if (data[0].charCodeAt(0) >= 48 && data[0].charCodeAt(0) <= 57) {
				for (var i:int = 0; i < data.length - 1; i++) {
					for (var j:int = i + 1; j < data.length; j++) {
						if (data[i] > data[j]) {
							var temp:String = data[i];
							data[i] = data[j];
							data[j] = temp;
						}
					}
				}
			}
			
			return data;
		}
	}
}